{include file="common/head"}
<head>
<title>教练车新增</title>
</head>
<body style="">
    <div class="container p-3 my-3 " style="max-width: 600px;"  >
    <h2>教练车新增</h2>
    <form method="post" enctype="multipart/form-data" action="/index.php/car/car_add">

      <div class="mb-3 mt-3">
        <lable for="cat" class="form-label">所属分类(Categray):</label>
        <select id="cat" name="cat" class="form-control">
            {foreach $category as $k=>$v}
              {if $v['deepth']==1}
              <option value="{$k}" >|--{$v['name']}</option>
              {elseif $v['deepth']==2}
              <option value="{$k}" >|----{$v['name']}</option>
              {elseif $v['deepth']==3}
              <option value="{$k}" >|------{$v['name']}</option>
              {else}
              <option value="{$k}" >{$v['name']}</option>
              {/if}
            {/foreach} 

        </select>
      </div>

      <div class="mb-3 mt-3">
        <lable for="dept_id" class="form-label">所属驾校:</label>
        <select id="dept_id" name="dept_id" class="form-control">
          <option value="" >未选选择</option>
          {foreach $school as $dept}
              <option value="{$dept.id}" selected >{$dept['name']}</option>
          {/foreach}
        </select>
      </div>      
      <div class="mb-3">
        <label for="license" class="form-label">车牌号:</label>
        <input type="text" class="form-control" id="license" name="license" value="" placeholder="license" />
      </div>

      <div class="mb-3 mt-3">
        <lable for="name" class="form-label">车型:</label>
        <input type="text" class="form-control" id="name" name="name" value="" placeholder="name" />
      </div>
      <div class="mb-3 mt-3">
        <lable for="year" class="form-label">年份:</label>
        <input type="text" class="form-control" id="year" name="year" value="" placeholder="year" />
      </div>      
      <div class="mb-3">
        <label for="style" class="form-label">款式:</label>
        <input type="text" class="form-control" id="style" name="style" value="" placeholder="style" />
      </div>



      <div class="mb-3">
        <img src="" style="width: 200px;"/><br />
        <label for="file" class="form-label">上传图片(Image):</label>
        <input type="file"  name="file" /> <br> 
      </div>

      <div class="mb-3">
        <label for="status" class="form-label">是否启用(Using):</label>
          <input type="radio" class="form-check-input" id="radio1" name="status" value="1" checked /> 
          <label class="form-check-label" for="radio1">启用(Using)</label>
          <input type="radio" class="form-check-input" id="radio2" name="status" value="2" />
          <label class="form-check-label" for="radio2">停用(Stoped)</label>
       </div>
      <button  type="button" class="btn btn-primary" onclick="doSave()">保存(Save)</button>

    </form>
    </div>

<script type="text/javascript">
  function doSave(){
    $('form').submit();
  }
</script>


</body>
</html>
